-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix handling of different iovec struct layouts / enums #1086
Conversation
And use "version flavor" naming scheme
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1086 +/- ##
===========================================
- Coverage 81.93% 65.52% -16.41%
===========================================
Files 140 171 +31
Lines 11427 13057 +1630
===========================================
- Hits 9363 8556 -807
- Misses 1544 3823 +2279
- Partials 520 678 +158
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thanks for fixing this @rafaelroquetto! |
The Linux kernel has changed the layout of the
iov_iter
struct a few times since v5.8 (the minimum version we support). In particular:unsigned int
bitmask struct member calledtype
. The bitmasks were defined by theiter_type
enum. (reference)type
bitmask was replaced with an 8-bit member callediter_type
. This is no longer a bitmask, instead it carries a simple enumerator value. Theiter_type
enum was changed so that it is no longer defining bitmasks. (reference)iter_type
calledITER_UBUF
- it was the last enumerator in the enum definition and was assigned the value of 6. (reference)ITER_PIPE
and reassignedITER_BUF
to 5 (reference)iter_type
enum, assigningITER_UBUF
a value of 0, andITER_IOVEC
a value of 1 (previously it was 0). (reference)Beyla wasn't correctly checking for the type vs iter_type distinction, which caused the the iterator type to be wrongly resolved to
0
in kernel versions < 5.14. It was also assuming that the value ofITER_UBUF
to be 6, which was no longer true for kernels above 6.10. These caused Beyla to wrongly parsing the incoming msg header buffer, thus failing to extract races.The version of the
cilium/ebpf
component has been upgraded to v0.16.0 in order to address cilium/ebpf#1348 (git commit)This issue is potentially related to #1055
Tested on the following kernel versions/distros